#include <iostream>
using namespace std;
int binary(int a[],int i,int cnt)
{
	int low=0;
	int high=i;
	int ans=0;
	while(low<=high)
	{
		int mid=(low+high)/2;
		if(a[mid]<cnt)
		{
			low=mid+1;
		}
		else if(a[mid]>=cnt)
		{
			ans=mid;
			high=mid-1;
		}
	}
	return ans;
}

int main()
{
	int a[100];
	int n;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		cin >> a[i]; 
	} 
	for(int i=1;i<n;i++)
	{
		int j=binary(a,i,a[i]);
		int temp=a[i];
		for(int k=i;k>j;k--)
		{
			a[k]=a[k-1];
		}
		a[j]=temp;
	}
	for(int i=0;i<n;i++)
	{
		cout << a[i] << " ";
	}
	return 0;
}
